package com.test.service.impl;

import com.test.dao.IHouseValveHistoricalDao;
import com.test.model.HouseValveCurrentData;
import com.test.model.HouseValveHistoricalData;
import com.test.service.IHouseValueHistoricalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by ZZF on 2017/7/12.
 */
@Service
public class HouseValveHistoricalServiceImpl implements IHouseValueHistoricalService {

    @Autowired
    IHouseValveHistoricalDao houseValveHistoricalDao;

    @Override
    public void addHistorical(HouseValveCurrentData houseValveCurrentData) {


        HouseValveHistoricalData houseValveHistorical = new HouseValveHistoricalData();
        houseValveHistorical.setPlanTime(houseValveCurrentData.getPlanTime());
        houseValveHistorical.setHouseholdValveId(houseValveCurrentData.getHouseValveId());
        houseValveHistorical.setSwitchState(houseValveCurrentData.getSwitchState());

        houseValveHistoricalDao.save(houseValveHistorical);
    }

}
